package com.douyin.controller;
import com.douyin.dto.PageActionsDTO;
import com.douyin.dto.Result;
import com.douyin.service.LikesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 视频点赞表 前端控制器
 * </p>
 *
 * @author k
 * @since 2025-07-27
 */
@Slf4j
@RestController
@RequestMapping("/likes")
public class LikesController {
    @Autowired
    LikesService likesService;
    @PostMapping("/likeOrCancel/{videoId}")
    public Result likeOrDislike(@PathVariable Long videoId) {
        log.info("addLike:{}",videoId);
        return likesService.addLike(videoId);
    }
    @GetMapping("/getLikes")
    public Result getLikes(@RequestBody PageActionsDTO pageActionsDTO) {
        log.info("getLikes:{}",pageActionsDTO);
        return likesService.getLikes(pageActionsDTO);
    }
}

